import Vue from 'vue'
import Router from 'vue-router'

import employeeServ  from '@/components/router-component/employeeService'

//集团高管
const HighLeaderCard = r => require.ensure([],() => r(require('@/components/highLeaderCard/HighLeaderCard')),'HighLeaderCard');
const HighLeaderList = r => require.ensure([],() => r(require('@/components/highLeaderList/HighLeaderList')),'HighLeaderList');
//总部员工
const StaffCard = r => require.ensure([],() => r(require('@/components/staffCard/StaffCard')),'StaffCard');
const StaffList = r => require.ensure([],() => r(require('@/components/staffList/StaffList')),'StaffList');
const Homepage = r => require.ensure([],() => r(require('@/components/Homepage')),'Homepage');
const home = r => require.ensure([],() => r(require('@/components/home')),'home');
const login = r => require.ensure([],() => r(require('@/components/router-component/login')),'login');
const dept = r => require.ensure([],() => r(require('@/components/personal/dept')),'dept');
const backWorkLeader = r => require.ensure([],() => r(require('@/components/leader/backWorkLeader')),'backWorkLeader');
const keyEmployee = r => require.ensure([],() => r(require('@/components/router-component/keyEmployee')),'keyEmployee');
const groupDept = r => require.ensure([],() => r(require('@/components/router-component/groupDept')),'groupDept');
const degree = r => require.ensure([],() => r(require('@/components/router-component/degree')),'degree');
const deptSort = r => require.ensure([],() => r(require('@/components/router-component/deptSort')),'deptSort');
const leaderLook = r => require.ensure([], () => r(require('@/components/router-component/leaderLook')), 'leaderLook');
const cxoLook = r =>
  require.ensure(
    [],
    () => r(require("@/components/router-component/cxoLook")),
    "cxoLook"
  );
const hqStaff = r => require.ensure([], () => r(require('@/components/router-component/hqStaff')), 'hqStaff');
const allStaff = r => require.ensure([], () => r(require('@/components/router-component/allStaff')), 'allStaff');
const paymentData = r => require.ensure([], () => r(require('@/components/router-component/paymentData')), 'paymentData');

const approvalAll = r => require.ensure([], () => r(require('@/components/router-component/approvalAll')), 'approvalAll');
const noticeAll = r => require.ensure([], () => r(require('@/components/router-component/noticeAll')), 'noticeAll');
const mySalary = r => require.ensure([], () => r(require('@/components/router-component/mySalary')), 'mySalary');
const Keypostsettings = r => require.ensure([], () => r(require('@/components/router-component/Keypostsettings')), 'Keypostsettings');

const vacaManage = r => require.ensure([], () => r(require('@/components/router-component/vacaManage')), 'vacaManage');
const vacaMaintain = r => require.ensure([], () => r(require('@/components/router-component/vacaMaintain')), 'vacaMaintain');
const Group = r => require.ensure([], () => r(require('@/components/router-component/groupTree')), 'group');
const keyEmpployeeTree = r => require.ensure([], () => r(require('@/components/router-component/keyEmpployeeTree')), 'group');
const executivePay = r => require.ensure([], () => r(require('@/components/executivePay/executivePay')), 'executivePay');
const mySend = r => require.ensure([], () => r(require('@/components/employee/requestVacation/mySend')), 'mySend');
const myBackout = r => require.ensure([], () => r(require('@/components/employee/requestVacation/myBackout')), 'myBackout')
const requestVacation = r => require.ensure([], () => r(require('@/components/employee/requestVacation')), 'requestVacation');
const t1detail = r => require.ensure([], () => r(require('@/components/employee/requestVacation/tab1detail')), 't1detail');
const t2detail = r => require.ensure([], () => r(require('@/components/employee/requestVacation/tab2detail')), 't2detail');
const t3detail = r => require.ensure([], () => r(require('@/components/employee/requestVacation/tab3detail')), 't3detail');
const t4detail = r => require.ensure([], () => r(require('@/components/employee/requestVacation/tab4detail')), 't4detail');
const t5detail = r => require.ensure([], () => r(require('@/components/employee/requestVacation/tab5detail')), 't5detail');

// 权限管理
const userManager = r => require.ensure([], () => r(require('@/components/router-component/user')), 'userManager');
const roleManage = r => require.ensure([],() => r(require('@/components/router-component/roleManage')),'roleManage');
const authority = r => require.ensure([],() => r(require('@/components/router-component/authority')),'authority');
// const MenuManage = r => require.ensure([],() => r(require('@/components/router-component/powerManage/MenuManage')),'MenuManage');

//业务数据设置
const NoticeManage = r => require.ensure([], () => r(require('@/components/router-component/businessSet/NoticeManage')), 'NoticeManage');
const RecruitManage = r => require.ensure([], () => r(require('@/components/router-component/businessSet/RecruitManage')), 'RecruitManage');
const HrTargetManage = r => require.ensure([], () => r(require('@/components/router-component/businessSet/HrTargetManage')), 'HrTargetManage');
const TargetBusiness = r => require.ensure([], () => r(require('@/components/router-component/businessSet/TargetBusiness')), 'TargetBusiness');
const StaffRank = r => require.ensure([], () => r(require('@/components/router-component/businessSet/StaffRank')), 'StaffRank');
const RankPreIncome = r => require.ensure([], () => r(require('@/components/router-component/businessSet/RankPreIncome')), 'RankPreIncome');
const ManagerPreIncome = r => require.ensure([], () => r(require('@/components/router-component/businessSet/ManagerPreIncome')), 'ManagerPreIncome');
const employRoster = r => require.ensure([], () => r(require('@/components/router-component/employRoster')), 'employRoster');
//信息共享
const InformationShare = r => require.ensure([], () => r(require('@/components/router-component/informationShare')), 'InformationShare');
const backStageManager = r => require.ensure([], () => r(require('@/components/router-component/backStageManager')), 'backStageManager');
const PersonnelRecord = r => require.ensure([], () => r(require('@/components/router-component/PersonnelRecord')), 'PersonnelRecord');
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: "*",
      redirect: "/employeeServ"
    },
    {
      path: "/home",
      name: "HomePage",
      component: home,
      children: [
        {
          path: "highLeaderCard",
          name: "HighLeaderCard",
          component: HighLeaderCard
        },
        {
          path: "Group",
          name: "Group",
          component: Group
        },
        {
          path: "highLeaderList",
          name: "HighLeaderList",
          component: HighLeaderList
        },
        {
          path: "staffCard",
          name: "StaffCard",
          component: StaffCard
        },
        {
          path: "staffList",
          name: "StaffList",
          component: StaffList
        },
        {
          path: "homepage",
          name: "Homepage",
          component: Homepage,
          props: route => ({ query: route.query.q })
        },
        {
          path: "dept",
          name: "dept",
          component: dept
        },
        {
          path: "backWorkLeader",
          name: "backWorkLeader",
          component: backWorkLeader
        },
        {
          path: "keyEmployee",
          name: "keyEmployee",
          component: keyEmployee
        },
        {
          path: "groupDept",
          name: "groupDept",
          component: groupDept
        },
        {
          path: "leaderLook",
          name: "leaderLook",
          component: leaderLook
        },
        {
          path: "cxoLook",
          name: "cxoLook",
          component: cxoLook
        },
        {
          path: "hqStaff",
          name: "hqStaff",
          component: hqStaff
        },
        {
          path: "allStaff",
          name: "allStaff",
          component: allStaff
        },
        {
          path: "paymentData",
          name: "paymentData",
          component: paymentData
        },
        {
          path: "Keypostsettings",
          name: "Keypostsettings",
          component: Keypostsettings
        },
        {
          path: "keyEmpployeeTree",
          name: "keyEmpployeeTree",
          component: keyEmpployeeTree
        },
        {
          //员工花名册
          path: "employRoster",
          name: "employRoster",
          component: employRoster
        }
      ]
    },
    {
      path: "/loginToHuaYun",
      name: "login",
      component: login
    },
    {
      path: "/employeeServ",
      name: "employeeServ",
      component: employeeServ
    },
    {
      path: "/approvalAll",
      name: "approvalAll",
      component: approvalAll
    },
    {
      path: "/noticeAll",
      name: "noticeAll",
      component: noticeAll
    },
    {
      path: "/mySalary",
      name: "mySalary",
      component: mySalary
    },
    {
      path: "/requestVacation",
      name: "requestVacation",
      component: requestVacation
    },
    {
      path: "/mySend",
      name: "mySend",
      component: mySend
    },
    {
			path: '/myBackout',
			name: 'myBackout',
			component: myBackout
		},
		{
      path: "/requestVacation/t1detail",
      name: "t1detail",
      component: t1detail
    },
    {
      path: "/requestVacation/t2detail",
      name: "t2detail",
      component: t2detail
    },
    {
      path: "/requestVacation/t3detail",
      name: "t3detail",
      component: t3detail
    },
    {
      path: "/requestVacation/t4detail",
      name: "t4detail",
      component: t4detail
    },
    {
      path: "/requestVacation/t5detail",
      name: "t5detail",
      component: t5detail
    },
    {
      path: "/informationShare",
      name: "informationShare",
      component: InformationShare
    },
    {
      path: "/backStageManager",
      name: "backStageManager",
      component: backStageManager,
      children: [
        {
          path: "degree",
          name: "degree",
          component: degree
        },
        {
        	path : 'personnelRecord',
        	name:'personnelRecord',
        	component:PersonnelRecord
        },
        {
          // 用户管理
          path: "userManager",
          name: "userManager",
          component: userManager
        },
        {
          // 角色管理
          path: "roleManage",
          name: "roleManage",
          component: roleManage
        },
        {
          // 权限管理
          path: "authority",
          name: "authority",
          component: authority
        },
        {
          path: "leaderLook",
          name: "leaderLook",
          component: leaderLook
        },
        {
          path: "cxoLook",
          name: "cxoLook",
          component: cxoLook
        },
        {
          path: "hqStaff",
          name: "hqStaff",
          component: hqStaff
        },
        {
          path: "allStaff",
          name: "allStaff",
          component: allStaff
        },
        {
          path: "paymentData",
          name: "paymentData",
          component: paymentData
        },
        {
          path: "Keypostsettings",
          name: "Keypostsettings",
          component: Keypostsettings
        },
        {
          path: "vacaManage",
          name: "vacaManage",
          component: vacaManage
        },
        {
          path: "vacaMaintain",
          name: "vacaMaintain",
          component: vacaMaintain
        },

        {
          path: "keyEmpployeeTree",
          name: "keyEmpployeeTree",
          component: keyEmpployeeTree
        },
        {
          path: "executivePay",
          name: "executivePay",
          component: executivePay
        },
        {
          //通知公告管理
          path: "noticeManage",
          name: "NoticeManage",
          component: NoticeManage
        },
        {
          //招聘管理
          path: "recruitManage",
          name: "RecruitManage",
          component: RecruitManage
        },
        {
          //HR指标管理
          path: "hrTargetManage",
          name: "HrTargetManage",
          component: HrTargetManage
        },
        {
          //指标业务单位
          path: "targetBusiness",
          name: "TargetBusiness",
          component: TargetBusiness
        },
        {
          //人员职级
          path: "staffRank",
          name: "StaffRank",
          component: StaffRank
        },
        {
          //各职级人均收入
          path: "rankPreIncome",
          name: "RankPreIncome",
          component: RankPreIncome
        },
        {
          //总经理年收入基准值
          path: "managerPreIncome",
          name: "ManagerPreIncome",
          component: ManagerPreIncome
        },
        {
          path: "deptSort",
          name: "deptSort",
          component: deptSort
        },
        {
          path: "executivePay",
          name: "executivePay",
          component: executivePay
        }
      ]
    }
  ]
});
